package com.org.entity.sys;

import com.org.entity.base.BaseEntity;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotBlank;
import java.util.Date;

@Data
@Table(name = "SYS_MENU")
public class SysMenu extends BaseEntity {

    /**
     * 名称
     */
    @Column(name = "NAME")
    @NotBlank(message = "菜单名称不能为空！")
    private String name;

    /**
     * 是否启用图标
     */
    @Column(name = "HAS_ICON")
    private int hasIcon;

    /**
     * 图标
     */
    @Column(name = "ICON")
    private String icon;

    /**
     * 菜单路径
     */
    @Column(name = "URL")
    private String url;

    /**
     * 父节点ID
     */
    @Column(name = "PID")
    private String pid;

    /**
     * 状态
     */
    @Column(name = "STATE")
    private int state;

    /**
     * 排序
     */
    @Column(name = "SORT")
    private int sort;

    /**
     * 创建时间
     */
    @Column(name = "ADD_TIME")
    private Date addTime;

    /**
     * 父节点名称
     */
    @Transient
    private String pname;

    /**
     * 创建人
     */
    @Column(name = "ADD_USER_ID")
    private String addUserId;

    /**
     * 修改时间
     */
    @Column(name = "MODIFY_TIME")
    private Date modifyTime;

    /**
     * 修改人
     */
    @Column(name = "MODIFY_USER_ID")
    private String modifyUserId;

    /**
     * 所属系统
     */
    @Column(name = "FK_SYSTEM")
    private String fkSystem;

    /**
     * 所属系统名称
     */
    @Transient
    private String fkSystemName;

}


